<!DOCTYPE html>
<html lang='zh-CN'>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>邀请记录表</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/materialdesignicons.min.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.min.css" rel="stylesheet">
    <link href="js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link rel="stylesheet" href="js/ztree/zTreeStyle/zTreeStyle.css" type="text/css">

    <!--日期选择插件-->
    <link rel="stylesheet" href="js/bootstrap-datepicker/bootstrap-datepicker3.min.css">
    <link rel="stylesheet" href="js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css">
    <link href="css/style.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header"><h4>邀请记录</h4></div>

                <div class="card-body">
                    <ul id="myTabs" class="nav nav-tabs" role="tablist">
                        <li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab" onclick="dji('tb_memberFans')">下级管理表</a></li>
                        <li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab" onclick="dji('tb_memberLeaders')">上级管理表</a></li>
                    </ul>

                    <div id="myTabContent" class="tab-content">

                        <!--首页机制表按钮-->
                        <div class="tab-pane fade active in" id="home">
                            <form class="form-inline" method="post" id="searchFansForm">
                                <div class="form-group">
                                    <label>当前会员账号:</label>
                                    <input type="text" class="form-control" name="memberId">
                                </div>
                                <div class="form-group">
                                    <button class="btn btn-info btn_query btn-round" type="button" id="searchFansFormBtn">查询</button>
                                </div>
                            </form>
                            <table id="tb_memberFans"></table>

                        </div>

                        <!--首页记录表按钮-->
                        <div class="tab-pane fade" id="profile">
                            <form class="form-inline" method="post" id="searchLeadersForm">
                                <div class="form-group">
                                    <label>当前会员账号:</label>
                                    <input type="text" class="form-control" name="memberId" >
                                </div>
                                <div class="form-group">
                                    <button class="btn btn-info btn_query btn-round" type="button" id="searchLeadersFormBtn">查询</button>
                                </div>
                            </form>
                            <table  id="tb_memberLeaders"></table>
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>






</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-table/bootstrap-table.js"></script>
<script type="text/javascript" src="js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<!-- bootstrap表单验证插件 -->
<script type="text/javascript" src="js/bootstrapvalidator/dist/js/bootstrapValidator.js"></script>
<!-- jquery-form表单提交插件 -->
<script type="text/javascript" src="js/jquery-form/jquery.form.js"></script>
<!-- bootstrap弹出框插件 -->
<script type="text/javascript" src="js/jquery.bootstrap.min.js"></script>
<!--日期-->
<script src="js/bootstrap-datetimepicker/moment.min.js"></script>
<script src="js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="js/bootstrap-datetimepicker/locale/zh-cn.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>
<!-- 表单填充插件 -->
<script type="text/javascript" src="js/jquery-form/jquery.formloader.js"></script>
<!-- ztree树插件 -->
<script type="text/javascript" src="js/ztree/jquery.ztree.core.min.js"></script>
<script type="text/javascript" src="js/ztree/jquery.ztree.excheck.min.js"></script>
<script type="text/javascript" src="js/zero2one/zero2one.version.js"></script>
<script type="text/javascript" src="/js/zero2one/zero2one.core.js"></script>
<script type="text/javascript" src="js/zero2one/zero2one.ztree.js"></script>
<!-- ckeditor富文本插件 -->
<script src="js/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="js/bootstrapvalidator/dist/js/bootstrapValidator.js"></script>

<script type="text/javascript">

    //清除选中行
    function dji(tableId) {
        $('#'+tableId).bootstrapTable("uncheckAll");
    }

    //会员下级管理表
    var columns = [
        {checkbox: true},
        {field: 'memberId',title: '当前会员账号'},
        {field: 'levelType',title: '级别',formatter: function (value, row, index) {
                if (value=='1') {
                    return "一级";
                }else if(value=='2'){
                    return "二级";
                }
            }},
        {field: 'fansId',title: '粉丝账号'},
        {field: 'fansName',title: '粉丝名称'},
        {field: 'fansGrade',title: '粉丝等级',formatter: function (value, row, index) {
                if (value=='0') {
                    return "非会员";
                }else if(value=='1'){
                    return "会员";
                }
            }},
        {field: 'inviteTime',title: '邀请时间', formatter: function (value) {
                return zero2one.dateFormat(value, 'Y-m-d H:i:s')
            }}
    ];

    //进入主界面加载数据
    zero2one.datagrid("tb_memberFans", "/remote/memberFans/list",function (params) {
        return $.extend(zero2one.tableInitParam(params), zero2one.form2json("searchFansForm"));
    }, columns);

    //点击查询按钮重新加载页面数据
    $("#searchFansFormBtn").click(function () {
        zero2one.reload("tb_memberFans");
    });



    //加载首页机制表信息列表
    var columns2 = [
        {checkbox: true},
        {field: 'memberId',title: '当前会员账号'},
        {field: 'levelType',title: '级别',formatter: function (value, row, index) {
                if (value=='1') {
                    return "一级";
                }else if(value=='2'){
                    return "二级";
                }
            }},
        {field: 'leaderId',title: '上级账号'}
    ];

    //进入主界面加载数据
    zero2one.datagrid("tb_memberLeaders", "/remote/memberLeaders/list",function (params) {
        return $.extend(zero2one.tableInitParam(params), zero2one.form2json("searchLeadersForm"));
    }, columns2);

    //点击查询按钮重新加载页面数据
    $("#searchLeadersFormBtn").click(function () {
        $('#tb_memberLeaders').bootstrapTable('refresh');
    });



</script>

</body>
</html>
